﻿using System;
using System.Collections.Generic;
using System.Web.UI;
using Google.Translates.Core;

namespace ml_test_google_trans.Translate
{
    public partial class BreakSentencesByBingTrans : Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

        protected void btnBreakSentence_Click(object sender, EventArgs e)
        {
            DateTime startDate = DateTime.Now;
            List<string> reVal = new TranslatorByBingHttp().BreakSentences(txtSrc.Text, ddlFrom.SelectedValue);
            int amount = 0;
            foreach (string sentence in reVal)
            {
                txtTrg.Text += "\r\n\r\nBreak To Sentences by Index[ " + amount + " ]: \r\n";
                txtTrg.Text += sentence;
                amount++;
            }
            lblMsg.Text = "Uses Time : [" + (DateTime.Now - startDate).TotalMilliseconds + "]ms";
        }
    }
}